/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.ejb.sessionbean;

import cassys.dataaccess.DAOException;
import cassys.dataaccess.DAOFactory;
import cassys.dataaccess.LectureDAO;
import cassys.dataaccess.ModuleDAO;
import cassys.dataaccess.StudentDAO;
import cassys.dataaccess.UserDAO;
import cassys.datatransferobjects.LecturerDTO;
import cassys.datatransferobjects.ModuleDTO;
import cassys.datatransferobjects.StudentDTO;
import java.util.ArrayList;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
/**
 *
 * @author ASUS
 */
@Stateless(mappedName="StudentBean") 
public class StudentBean implements StudentBeanRemote{

     private StudentDAO studentDAO = null;
   
    public StudentBean(){
    }
    
    public void ejbCreate() {
       
        studentDAO = DAOFactory.getInstance().getStudentDAO();
    }
    
    @Override
    public ArrayList<StudentDTO> findAllStudents() throws DAOException {
       return studentDAO.findAllStudent();
    }

    @Override
    public StudentDTO findStudent(String userName) throws DAOException {
         return studentDAO.findStudent(userName);
    }

    @Override
    public void updateStudent(StudentDTO student) throws DAOException {
          studentDAO.updateStudent(student);
    }

    @Override
    public boolean studentValidate(String userid, String password) throws DAOException {
       return true;
    }

    @Override
    public void insertStudent(StudentDTO student) throws DAOException {
       studentDAO.insertStudent(student);
    }

    @Override
    public void deleteStudent(StudentDTO student) throws DAOException {
        studentDAO.deleteStudent(student);
    }

  

 
}
